<?php
namespace app\admin\controller;

use think\Controller;
use app\common\model\User as UserModel;
use app\common\model\Project as ProjectModel;

class IndexController extends Controller
{
    // public function index()
    // {
    //     // 入口跳转
    //     // $this->redirect('');
    //     $user_list = UserModel::all();
    //     // $user_list = array('id'=> 10, 'name'=> 'lin', 'phone'=>'123659874');
    //     foreach ($user_list as $item) {
    //         echo $item ->id . '</br>';
    //         echo $item->name . '</br>';
    //         echo $item->phone . '</br>';
    //     }
    // }

    public function index()
    {
        $user_count = UserModel::count();
        $project_count = ProjectModel::count();

        $this->assign([
            'user_count'=>$user_count,
            'project_count'=>$project_count,
            ]);
        return $this->fetch();
    }
}